package jrain.fw.core.http;

import java.util.HashMap;
import java.util.Map;

public class HttpRequest {

	private String url;

	private HttpMethod method = HttpMethod.POST;

	private Map<String, String> header = new HashMap<String, String>();

	private Map<String, String> data = new HashMap<String, String>();

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public HttpMethod getMethod() {
		return method;
	}

	public void setMethod(HttpMethod method) {
		this.method = method;
	}

	public Map<String, String> getHeader() {
		return header;
	}

	public void setHeader(Map<String, String> header) {
		this.header = header;
	}

	public String getHeader(String key) {
		return this.header.get(key);
	}

	public void putHeader(String key, String value) {
		this.header.put(key, value);
	}

	public void removeHeader(String key) {
		this.header.remove(key);
	}

	public void clearHeader(String key) {
		this.header.clear();
	}

	public Map<String, String> getData() {
		return data;
	}

	public void setData(Map<String, String> data) {
		this.data = data;
	}

	public String getData(String key) {
		return this.data.get(key);
	}

	public void putData(String key, String value) {
		this.data.put(key, value);
	}

	public void removeData(String key) {
		this.data.remove(key);
	}

	public void clearData(String key) {
		this.data.clear();
	}
}
